package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.httpmodel.AnotherResult;
import com.quasar.hpatient.model.medicalmodel.ArchivesData;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.viewInterface.UiInterface;

/**
 * author : 许建宏
 * Date: 2017/10/31 0031
 * View: 患者档案袋
 */

public class BagFilePresenter {

    private RequestModel requestModel;
    private UiInterface<AnotherResult<ArchivesData>> uiInterface;

    public BagFilePresenter(UiInterface<AnotherResult<ArchivesData>> uiInterface) {
        this.requestModel = new RequestModel();
        this.uiInterface = uiInterface;
    }

    public void PostBagFile(String page){

        requestModel.ArchivesData(page, new AnotherResultListener<AnotherResult<ArchivesData>>() {
            @Override
            public void onSuccess(AnotherResult<ArchivesData> data) {
                uiInterface.onViewSuccess(data);
            }

            @Override
            public void onError(String msg) {
                uiInterface.onViewError(msg);
            }

            @Override
            public void onRefreshUI() {
                uiInterface.onViewRefreshUI();
            }
        });

    }
}
